﻿
/*----------------------------------------------------------------//
// 文件名：MoKeptLog.cs
// 文件功能描述：实体 MoKeptLog.
// 
// 创建标识：Template  ver 5.0.20090429 2009-11-20
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoKeptLog
using System;
using System.Data;
namespace EQT.Model
{
    /// <summary>
    /// 业务实体MoKeptLog
    /// </summary>
    public partial class MoKeptLog : ICloneable
    {
        #region 表KeptLog的字段
        private int kptLogId;
        private string equipId;
        private DateTime kptBegin;
        private string userCode1;
        private string userCode2;
        private DateTime kptEnd;
        private string kptAddr;
        private int kptStatus;
        private string rem;
        #endregion

        #region 构造函数
        public MoKeptLog()
        {
            kptBegin = new DateTime(1900, 1, 1); kptEnd = new DateTime(1900, 1, 1);

        }
        #endregion

        #region 拷贝构造函数

        public MoKeptLog(MoKeptLog item)
        {
            item.CopyTo(this);
        }
        #endregion

        #region 带参数构造函数
        public MoKeptLog(int kptLogId, string equipId, DateTime kptBegin, string userCode1, string userCode2, DateTime kptEnd, string kptAddr, int kptStatus, string rem)
        {
            this.kptLogId = kptLogId;
            this.equipId = equipId;
            this.kptBegin = kptBegin;
            this.userCode1 = userCode1;
            this.userCode2 = userCode2;
            this.kptEnd = kptEnd;
            this.kptAddr = kptAddr;
            this.kptStatus = kptStatus;
            this.rem = rem;
        }
        #endregion

        #region 表KeptLog的字段属性
        /// <summary>
        /// KPT_LOG_ID
        /// </summary>
        public int KptLogId
        {
            get { return kptLogId; }
            set { kptLogId = value; }
        }
        /// <summary>
        /// EQUIP_ID
        /// </summary>
        public string EquipId
        {
            get { return equipId; }
            set { equipId = value; }
        }
        /// <summary>
        /// KPT_BEGIN
        /// </summary>
        public DateTime KptBegin
        {
            get { return kptBegin; }
            set { kptBegin = value; }
        }
        /// <summary>
        ///没有人交接时，则为空。
        /// </summary>
        public string UserCode1
        {
            get { return userCode1; }
            set { userCode1 = value; }
        }
        /// <summary>
        /// USER_CODE2
        /// </summary>
        public string UserCode2
        {
            get { return userCode2; }
            set { userCode2 = value; }
        }
        /// <summary>
        ///实际就是交接日期.
        /// </summary>
        public DateTime KptEnd
        {
            get { return kptEnd; }
            set { kptEnd = value; }
        }
        /// <summary>
        /// KPT_ADDR
        /// </summary>
        public string KptAddr
        {
            get { return kptAddr; }
            set { kptAddr = value; }
        }
        /// <summary>
        ///0--未知，1--在管,2--已交接
        /// </summary>
        public int KptStatus
        {
            get { return kptStatus; }
            set { kptStatus = value; }
        }
        /// <summary>
        /// REM
        /// </summary>
        public string Rem
        {
            get { return rem; }
            set { rem = value; }
        }
        #endregion

        #region 辅助函数
        /// <summary>
        /// 拷贝函数
        /// </summary>
        public MoKeptLog CopyTo(MoKeptLog item)
        {
            item.kptLogId = this.kptLogId;
            item.equipId = this.equipId;
            item.kptBegin = this.kptBegin;
            item.userCode1 = this.userCode1;
            item.userCode2 = this.userCode2;
            item.kptEnd = this.kptEnd;
            item.kptAddr = this.kptAddr;
            item.kptStatus = this.kptStatus;
            item.rem = this.rem;
            return item;
        }
        /// <summary>
        /// 克隆函数
        /// </summary>		
        public object Clone()
        {
            MoKeptLog mo = new MoKeptLog();
            mo.KptLogId = this.KptLogId;
            mo.EquipId = this.EquipId;
            mo.KptBegin = this.KptBegin;
            mo.UserCode1 = this.UserCode1;
            mo.UserCode2 = this.UserCode2;
            mo.KptEnd = this.KptEnd;
            mo.KptAddr = this.KptAddr;
            mo.KptStatus = this.KptStatus;
            mo.Rem = this.Rem;
            return mo;
        }
        ///<summary>
        ///判断对象是否相等
        ///<summary>
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return true;
            }
            else
            {
                MoKeptLog NewKeptLog = obj as MoKeptLog;
                if (NewKeptLog == null)
                {
                    return false;
                }
                else
                {
                    if (NewKeptLog.KptLogId == this.KptLogId && NewKeptLog.EquipId == this.EquipId && NewKeptLog.KptBegin == this.KptBegin && NewKeptLog.UserCode1 == this.UserCode1 && NewKeptLog.UserCode2 == this.UserCode2 && NewKeptLog.KptEnd == this.KptEnd && NewKeptLog.KptAddr == this.KptAddr && NewKeptLog.KptStatus == this.KptStatus && NewKeptLog.Rem == this.Rem)
                    {
                        return true;
                    }
                }

            }
            return false;

        }
        ///TODO:you should modify GetHashCode by yourself.
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override string ToString()
        {
            return String.Format(System.Globalization.CultureInfo.InvariantCulture, "KptLogId={0}/EquipId={1}/KptBegin={2}/UserCode1={3}/UserCode2={4}/KptEnd={5}/KptAddr={6}/KptStatus={7}/Rem={8}", kptLogId, equipId, kptBegin, userCode1, userCode2, kptEnd, kptAddr, kptStatus, rem);

        }
        #endregion


        #region DataTable Help Function
        ///<summary>
        ///DataRow转换成Model
        ///</summary>
        public void Row2Model(DataRow row)
        {
            if (row["Kpt_Log_ID"] != null && row["Kpt_Log_ID"] != DBNull.Value)
            {
                this.KptLogId = (int)row["Kpt_Log_ID"];
            }
            else
            {
                this.KptLogId = 0;
            }
            if (row["Equip_ID"] != null && row["Equip_ID"] != DBNull.Value)
            {
                this.EquipId = (string)row["Equip_ID"];
            }
            else
            {
                this.EquipId = string.Empty;
            }
            if (row["Kpt_Begin"] != null && row["Kpt_Begin"] != DBNull.Value)
            {
                this.KptBegin = (DateTime)row["Kpt_Begin"];
            }
            else
            {
                this.KptBegin = DateTime.MinValue;
            }
            if (row["User_Code1"] != null && row["User_Code1"] != DBNull.Value)
            {
                this.UserCode1 = (string)row["User_Code1"];
            }
            else
            {
                this.UserCode1 = string.Empty;
            }
            if (row["User_Code2"] != null && row["User_Code2"] != DBNull.Value)
            {
                this.UserCode2 = (string)row["User_Code2"];
            }
            else
            {
                this.UserCode2 = string.Empty;
            }
            if (row["Kpt_End"] != null && row["Kpt_End"] != DBNull.Value)
            {
                this.KptEnd = (DateTime)row["Kpt_End"];
            }
            else
            {
                this.KptEnd = DateTime.MinValue;
            }
            if (row["Kpt_Addr"] != null && row["Kpt_Addr"] != DBNull.Value)
            {
                this.KptAddr = (string)row["Kpt_Addr"];
            }
            else
            {
                this.KptAddr = string.Empty;
            }
            if (row["Kpt_Status"] != null && row["Kpt_Status"] != DBNull.Value)
            {
                this.KptStatus = (int)row["Kpt_Status"];
            }
            else
            {
                this.KptStatus = 0;
            }
            if (row["Rem"] != null && row["Rem"] != DBNull.Value)
            {
                this.Rem = (string)row["Rem"];
            }
            else
            {
                this.Rem = string.Empty;
            }
        }

        ///<summary>
        ///Model转换成DataRow
        ///</summary>
        public void Model2Row(DataRow row)
        {
            row["Kpt_Log_ID"] = this.KptLogId;
            row["Equip_ID"] = this.EquipId;
            row["Kpt_Begin"] = this.KptBegin;
            row["User_Code1"] = this.UserCode1;
            row["User_Code2"] = this.UserCode2;
            row["Kpt_End"] = this.KptEnd;
            row["Kpt_Addr"] = this.KptAddr;
            row["Kpt_Status"] = this.KptStatus;
            row["Rem"] = this.Rem;
        }
        #endregion
    }
}
#endregion
